<script setup>
import useCopy from '../../composable/useCopy'

const { handleCopy } = useCopy()

defineProps({
  data: Object,
  ref_table: Object,
})
</script>

<template>
  <el-table
    class="search-list__table"
    ref="ref_table"
    :data="data"
  >
    <el-column label="图片">
      <template #content="{ row }">
        <el-link :href="row.link">
          <img :src="row.pic_url" :alt="pic_url">
        </el-link>
      </template>
    </el-column>
    <el-column label="标题">
      <template #content="{ row }">
        {{ row.title }}
      </template>
    </el-column>
    <el-column label="价格">
      <template #content="{ row }">
        {{ row.price }}
      </template>
    </el-column>
    <el-column label="销量">
      <template #content="{ row }">
        {{ row.sales }}
      </template>
    </el-column>
    <el-column label="操作">
      <el-button
        type="primary"
        size="mini"
        @click="handleCopy('current')"
      >一键复制</el-button>
    </el-column>
  </el-table>
</template>

<style lang="scss" scoped>

</style>